package com.yy.wga.pay.feign.api;

import com.yy.wga.common.core.dto.Result;
import com.yy.wga.pay.feign.request.third.WechatPayNotifyOriginRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 微信通知接口
 *
 * @author guochao
 * @date 2021/6/5 17:00
 */
@FeignClient(name = "WechatNotifyFeign",
        url = "http://127.0.0.1:9100",
        path = "/api/pay/third/wechat")
public interface WechatNotifyFeign {

    /**
     * 异步通知
     * @param mchId
     * @param request
     * @return
     */
    @PostMapping(value = "/pay/notify/{appKey}/{mchId}")
    Result<Void> payNotify(@PathVariable(name = "mchId") String mchId,
                                 @PathVariable(name = "appKey") String appKey,
                                 @RequestBody WechatPayNotifyOriginRequest request);

    /**
     * 异步通知
     * @param mchId
     * @param request
     * @return
     */
    @PostMapping(value = "/transfer/notify/{appKey}/{mchId}")
    Result<Void> transferNotify(@PathVariable(name = "mchId") String mchId,
                                     @PathVariable(name = "appKey") String appKey,
                                     @RequestBody WechatPayNotifyOriginRequest request);

    /**
     * 异步通知
     * @param mchId
     * @param request
     * @return
     */
    @PostMapping(value = "/refund/notify/{appKey}/{mchId}")
    Result<Void> refundNotify(@PathVariable(name = "mchId") String mchId,
                                     @PathVariable(name = "appKey") String appKey,
                                     @RequestBody WechatPayNotifyOriginRequest request);
}
